{extend name="public:base"}
{block name="main"}
<form class="form-horizontal" action="{:Url('admin/adminadd')}" method="POST">
  <div class="box-body">
    <div class="form-group">
      <label for="inputEmail3" class="col-sm-2 control-label">管理员名称</label>

      <div class="col-sm-10">
        <input type="text" class="form-control" name="name" placeholder="请输入管理员名称">
      </div>
    </div>
    <div class="form-group">
      <label for="inputPassword3" class="col-sm-2 control-label">管理员账号</label>

      <div class="col-sm-10">
        <input type="text" class="form-control" name="username"  placeholder="请输入管理员账号">
      </div>
    </div>
    <div class="form-group">
      <label for="inputPassword3" class="col-sm-2 control-label">管理员密码</label>

      <div class="col-sm-10">
        <input type="password" class="form-control" name="password" placeholder="请输入管理员密码">
      </div>
    </div>
  </div>
  <!-- /.box-body -->
  <div class="box-footer">
    <button type="button" class="btn btn-info pull-right" id="add">立即添加</button>
  </div>
  <!-- /.box-footer -->
</form>
<script type="text/javascript">
	$("#add").click(function(){
		var name=$("input[name='name']").val();
		var username=$("input[name='username']").val();
		var password=$("input[name='password']").val();
		if(name==''){
			alert("请输入管理员名称");
		}else if(username==''){
			alert("请输入管理员账号");
		}else if(password==''){
			alert("请输入管理员密码");
		}else{
			$("form").submit();
		}
	})

</script>
{/block}